<?php
use yii\helpers\Html;
use yii\widgets\DetailView;
use yii\bootstrap\ActiveForm;
?>

<style type="text/css">
	.list-group-item p {float:left; width:20%; height:35px;}
	.detail .row div {height: 35px;}
</style>

<div class="modal-header">
	<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">×</span></button>
	<h4 class="modal-title"><small>价格明细</small></h4>
</div>

<div class="detail">
	<div class="row" style="margin-top:15px;font-weight:bold;">
		<div class="col-md-offset-1 col-md-2">项目</div>
		<div class="col-md-2">类型</div>
		<div class="col-md-2">单价</div>
		<div class="col-md-2">数量</div>
		<div class="col-md-2">合计</div>
	</div>
	<hr style="margin:0px 0 5px 0;color:#aaa;">

	<div class="row">
		<div class="col-md-offset-1 col-md-2">舱房总计</div>
		<div class="col-md-2">舱房</div>
		<div class="col-md-2"><?= $model->total_sale?></div>
		<div class="col-md-2">-</div>
		<div class="col-md-2"><?= $model->total_sale?></div>
	</div>
	<?php if($model->room){ ?>
		<?php foreach($model->room as $room){ ?>
		<div class="row" style="color:#aaa;font-size:12px;">
			<div class="col-md-offset-1 col-md-2"></div>
			<div class="col-md-2"><?php print_r($room->roomName) ?></div>
			<?php if($model->product->stock == 2){ ?>
				<div class="col-md-2">
					<?php $arr = json_decode($room->product->rooms, true); ?> 
					<?php   
							if($model->source == 1){
								if($room->num <= 2){
									print_r($arr[$room->room_id]['price']); 
								}else{
									print_r($arr[$room->room_id]['price'] . ' / ');  
									print_r($arr[$room->room_id]['price2']); 
								}
							}elseif($model->source == 2){
								if($room->num <= 2){
									print_r($arr[$room->room_id]['inside_price']); 
								}else{
									print_r($arr[$room->room_id]['inside_price'] . ' | ');  
									print_r($arr[$room->room_id]['inside_price2']); 
								}
							}
					?> 
				</div>
			<?php }else{ ?>
				<div class="col-md-2"><?= $room->price/$room->num ?> </div>
			<?php } ?>
			<div class="col-md-2"><?= $room->num ?></div>
			<div class="col-md-2"><?= $room->price ?></div>
		</div>
		<?php } ?>
	<?php } ?>

	<div class="row">
		<div class="col-md-offset-1 col-md-2"></div>
		<div class="col-md-2">
			<a data-toggle="collapse" href="#collapse" aria-expanded="false" aria-controls="collapse">退舱扣款</a>
		</div>
		<div class="col-md-2"></div>
		<div class="col-md-2"></div>
		<div class="col-md-2"><?= $model->refund_price ?></div>
	</div>

	<!-- 舱房退扣明细 -->
	<div class="collapse" id="collapse">
	<?php foreach($model->refund as $refund) { ?>
		<div class="row" style="color: #999;font-size:12px;">
			<div class="col-md-offset-1 col-md-2"></div>
			<div class="col-md-2"><?= $refund->room ?></div>
			<div class="col-md-2"><?= \Yii::$app->params['refund'][$refund->status] ?></div>
			<div class="col-md-2">1</div>
			<div class="col-md-2"><?= $refund->price ?></div>
		</div>
	<?php } ?>
	</div>

	<?php if($model->priceAll){ 
			foreach($model->priceAll as $att){
		?>
		<div class="row">
			<div class="col-md-offset-1 col-md-2"><?= $att->typeObj->name ?></div>
			<div class="col-md-2">附加费</div>
			<div class="col-md-2"><?= $att->price ?></div>
			<div class="col-md-2"><?= $att->num ?></div>
			<div class="col-md-2"><?= $att->total_price ?></div>
		</div>
	<?php } } ?>

	<div class="row"  style="color:red;">
		<div class="col-md-offset-1 col-md-2">后返</div>
		<div class="col-md-2">无需审核</div>
		<div class="col-md-2"><?= $model->commiss ?></div>
		<div class="col-md-2">1</div>
		<div class="col-md-2">- <?= $model->commiss ?></div>
	</div>

	<div class="row"  style="color:red;">
		<div class="col-md-offset-1 col-md-2">优惠</div>
		<div class="col-md-2"><?= \Yii::$app->params['order_check'][$model->check] ?></div>
		<div class="col-md-2"><?= $model->sale_price ?></div>
		<div class="col-md-2">1</div>
		<div class="col-md-2">- <?= $model->sale_price ?></div>
	</div>

	<div class="row">
		<div class="col-md-offset-1 col-md-8"></div>
		<div class="col-md-3"><b>合计 : <?= $model->price ?></b></div>
	</div>
</div>

